/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package interfazAWT;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
import java.awt.Panel;
import java.awt.TextArea;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 *
 * @author djdracku
 */
public class TestPaint {
     Frame f=new Frame("Paint");
    Panel ocul=new Panel();
    TextArea t=new TextArea();
    Panel arri=new Panel();
    Menu me = new Menu("Archivo");
        MenuBar bar = new MenuBar();
        MenuItem mi1 = new MenuItem("Nuevo");
        MenuItem mi2 = new MenuItem("Salir");
        Menu mi = new Menu("Ver");
        MenuItem mi3 = new MenuItem("Ver");


     public void visible() {


        f.setBackground(Color.BLACK);
        ocul.setLayout(new GridLayout(7, 7));
        f.setSize(600, 600);
        f.setResizable(false);


         mi2.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });



        f.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });


        mi1.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {

            Paint p=new Paint();
            p.visible();
            f.dispose();
            }
        });

         mi3.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {

            Paint2 p=new Paint2();
            p.visible();
            f.dispose();
            }
        });

        f.add(BorderLayout.CENTER, t);
        arri.setLayout(new GridLayout());


        me.add(mi1 );
        me.add(mi2);
        mi.add(mi3);
        bar.add(me);
        bar.add(mi);
        f.setMenuBar(bar);

        f.setLocation(200, 100);
        f.setVisible(true);


    }

   public static void main(String args[]){
       TestPaint p=new TestPaint();
       p.visible();


    }




}
